<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="./resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="./resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <title>Tisy - Ticket System</title>
    </h:head>

    <h:body>

        <div id="top">
            <ui:insert name="top">Tisy - Ticket System v1.0</ui:insert>
        </div>
        <div>
            <div id="menu">
                <ui:insert name="menu">
                    <h:form>
                        <p:menu position="center">
                            <p:submenu label="Tickety" icon="ui-icon-document">
                                <p:menuitem value="Nový ticket" url="ticketNew.xhtml" rendered="#{login.loggedSystemCustomer}" />
                                <p:menuitem value="Procházet tickety" url="ticketList.xhtml" />
                            </p:submenu>

                            <p:submenu label="Kategorie" icon="ui-icon-document" rendered="#{login.loggedSystemAdmin}">
                                <p:menuitem value="Nová kategorie" url="categoryNew.xhtml" />
                                <p:menuitem value="Procházet kategorie" url="categoryList.xhtml" />

                            </p:submenu>
                            <p:submenu label="Uživatelé" icon="ui-icon-contact" rendered="#{login.loggedSystemAdmin}">
                                <p:menuitem value="Nový uživatel" url="userNew.xhtml" rendered="#{login.loggedSystemAdmin}" />
                                <p:menuitem value="Procházet uživatele" url="userList.xhtml" rendered="#{login.loggedSystemAdmin}" />                                
                            </p:submenu>
                        </p:menu>
                    </h:form>
                </ui:insert>
            </div>
            <div>
                <div id="right">
                    <ui:insert name="right">
                        <p:panelGrid columns="1" style="width:100%">
                            <f:facet name="header">
                                <h:outputText value="Informace"/>
                            </f:facet>
                            <h:outputText class="user_name" value="#{login.loggedUser}"/>
                            <f:facet name="footer">
                                <h:form>
                                    <p:commandButton value="Odlásit se" action="#{login.logout()}"/>
                                </h:form> 
                            </f:facet>
                        </p:panelGrid>


                    </ui:insert>
                </div>
                <div id="show_messages" style="margin: 0 210px 0 170px; padding-right: 5px">
                    <ui:insert name="show_messages" >
                        <p:messages id="messages" showDetail="true" autoUpdate="true"/>  
                    </ui:insert>
                </div> 
                <div id="content" class="right_content">
                    <ui:insert name="content">Content</ui:insert>

                </div>
            </div>
        </div>
        <div id="bottom">
            <ui:insert name="bottom">&copy; 2012 Petr Hejhal &amp; Petr Smrček (fel.cvut.cz)</ui:insert>
        </div>

        <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();" />
        <p:dialog modal="true" widgetVar="statusDialog" draggable="false" closable="false" resizable="false">  
            <p:graphicImage value="./resources/images/loading.gif" />
        </p:dialog>

    </h:body>

</html>
